const menuStore = {
	state: {
		isCollapse: false,
		pageData: {
			pageNum: 1,
		},
		searchValue: "",
	},
	actions: {
		updateIsCollapse({ commit }) {
			commit("UPDATEISCOLLAPSE");
		},
		updatePageNum: ({ commit }, num) => {
			console.log("num: ", num);
			commit("UPDATEPAGEMUN", num);
		},
		updateSearch({ commit }, value) {
			commit("UPDATESEARCH", value);
		},
	},
	mutations: {
		UPDATEISCOLLAPSE: (state) => {
			state.isCollapse = !state.isCollapse;
		},
		UPDATEPAGEMUN: (state, num) => {
			state.pageData.pageNum = num;
		},
		UPDATESEARCH: (state, value) => {
			state.searchValue = value;
		},
	},
};
export default menuStore;
